import request from '@/utils/request'

// 查询预警列表
export function listAlerts(query) {
  return request({
    url: '/dashboard/alerts/list',
    method: 'get',
    params: query
  })
}

// 一键已读
export function readAllAlerts() {
  return request({
    url: '/dashboard/alerts/readAll',
    method: 'post'
  })
}

// Mark an alert as read
export function markAlertAsRead(alertId) {
  return request({
    url: '/dashboard/alerts/' + alertId + '/read',
    method: 'put'
  })
} 